package com.sk.bilibili.mapper;

import com.sk.api.annotations.Mapper;
import com.sk.bilibili.bean.Live;
import com.sk.bilibili.bean.Member;
import com.sk.bilibili.bean.Search;
import com.sk.bilibili.bean.Them;
import com.sk.bilibili.bean.VideoSet;
import com.sk.bilibili.dto.Page;
import com.sk.bilibili.dto.Res;
import com.sk.bilibili.other.JsonMap;

import java.util.List;

import io.reactivex.Observable;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

@Mapper
public interface SearchMapper {

    @GET("search/getHistory")
    Observable<Res<List<Search>>> getHistory();

    @GET("search/deleteAll")
    Observable<Res<Void>> deleteAll();

    @GET("search/getRandom")
    Observable<Res<List<Search>>> getRandom(@Query("size") Integer size);

    @POST("search/searchVideo")
    Observable<Res<Page<VideoSet>>> searchVideo(@Body JsonMap map);

    @GET("search/addSearchHistory")
    Observable<Res<Void>> addSearchHistory(@Query("keyword")String keyword);

    @POST("search/searchThem")
    Observable<Res<Page<Them>>> searchThem(@Body JsonMap map);

    @POST("search/searchLive")
    Observable<Res<Page<Live>>> searchLive(@Body JsonMap map);

    @POST("search/searchMember")
    Observable<Res<Page<Member>>> searchMember(@Body JsonMap map);

}